package com.wg.user.service.impl;

import com.wg.user.mapper.UserMapper;
import com.wg.user.model.User;
import com.wg.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by mc on 18/8/8.
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public Long create(User user) {
        userMapper.insertUser(user);
        return user.getId();
    }

    @Override
    public User getByName(String name) {
        return userMapper.selectByName(name);
    }
}
